import { BrowserRouter, Route, Routes } from 'react-router-dom'
import GeekLayout from '@/pages/Layout/index'
import Login from '@/pages/Login/index'
import { AuthRoute } from '@/components/AuthRoute/index'
import Home from '@/pages/Home/index'
import Article from '@/pages/Article/index'
import Publish from '@/pages/Publish/index'
import { HistoryRouter, history } from '@/utils/index'
export default function App() {
  return (
    <HistoryRouter history={history}>
      <Routes>
        <Route
          path="/"
          element={
            <AuthRoute>
              <GeekLayout />
            </AuthRoute>
          }>
          <Route index element={<Home></Home>}></Route>
          <Route path="/article" element={<Article></Article>}></Route>
          <Route path="/publish" element={<Publish></Publish>}></Route>
        </Route>
        <Route path="/login" element={<Login />}></Route>
      </Routes>
    </HistoryRouter>
  )
}
